{% extends 'ForkCMSInstallerBundle:Installer:base.html.twig' %}
{% import 'ForkCMSInstallerBundle:Installer:navigation.html.twig' as macro %}

{% form_theme form 'ForkCMSInstallerBundle:Installer:form_theme.html.twig' %}

{% block navigation %}
  {{ macro.navigation('step-5') }}
{% endblock %}

{% block content %}

  {{ form_start(form) }}
  <div class="row fork-module-messages">
    <div class="col-md-12">
      {{ form_errors(form) }}
    </div>
  </div>
  <div class="row fork-module-content">
    <div class="col-md-12">
      <div class="panel panel-default">
        <div class="panel-heading">
          <h2 class="panel-title">
            Settings
          </h2>
        </div>
        <div class="panel-body">
          <p>Enter the e-mail address and password you'd like to use to log in.</p>
          {{ form_row(form.email) }}

          <div class="form-group{% if form.password.first.vars.errors|length %} has-error{% endif %}">
            {{ form_label(form.password.first) }}
            <table id="passwordStrengthMeter" class="passwordStrength" data-id="install_login_password_first">
              <tr>
                <td class="strength" id="passwordStrength">
                  <p class="strength none">
                    <span class="label label-default">None</span>
                  </p>
                  <p class="strength weak">
                    <span class="label label-danger">Weak</span>
                  </p>
                  <p class="strength average">
                    <span class="label label-warning">Average</span>
                  </p>
                  <p class="strength strong">
                    <span class="label label-success">Strong</span>
                  </p>
                </td>
                <td>
                  <p class="help-block">&nbsp;Strong passwords consist of a combination of capitals, small letters, digits and special characters.</p>
                </td>
              </tr>
            </table>
            {{ form_widget(form.password.first) }}
            {{ form_errors(form.password.first) }}
          </div>
          {{ form_row(form.password.second) }}
        </div>
        <div class="panel-footer">
          <div class="btn-toolbar">
            <div class="btn-group pull-left" role="group">
              <a href="{{ path('install_step4') }}" class="btn btn-default">
                <span class="fa fa-chevron-left" aria-hidden="true"></span>&nbsp;
                Previous
              </a>
            </div>
            <div class="btn-group pull-right" role="group">
              <button type="submit" id="installerButton" name="installer" class="btn btn-primary">
                Finish installation
                <div id="ajaxSpinner" style="float: left; margin-top: 4px; display: none;" aria-label="please wait while fork is installing">
                  <i class="fa fa-spinner fa-pulse fa-lg fa-fw" aria-hidden="true"></i>
                </div>
              </button>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
  {{ form_end(form) }}

{% endblock %}
